(function(a) {
	function b() {
		var $selectedvalue = a("input[name='EmailSettingForm[enabledEmail]']:checked").val();
		if($selectedvalue=="0"){
			a("#emailSettingDiv").hide();
			a("#emailTestDiv").hide();
		}else{
			a("#emailSettingDiv").show();
			a("#emailTestDiv").show();
		}
	}
	function c() {
		var $selectedvalue = a("input[name='EmailSettingForm[enabledMailFun]']:checked").val();
		if($selectedvalue=="1"){
			a("#mainEnabled").hide();
		}else{
			a("#mainEnabled").show();
		}
	}
	function d() {
		var $selectedvalue = a("input[name='EmailSettingForm[checkAuth]']:checked").val();
		if($selectedvalue=="0"){
			a("#checkAuthEnabled").hide();
		}else{
			a("#checkAuthEnabled").show();
		}
	}
	a(document)
			.ready(
					function() {
						b();
						c();
						d();
						a(".emailradio").change( 
								function() {
									b();
								}
								);
						a(".mainradio").change( 
								function() {
									c();
								}
								);
						a(".authradio").change( 
								function() {
									d();
								}
								);
						a("input[type=submit]").click(function(){
							a("#EmailSettingForm_action").val(a(this).attr('name'));
						});
						 
					})
})(jQuery);